<?php

class Parser_Form_Parser extends Zend_Form
{

    public function init()
    {
        $this->setMethod('POST');
        $this->setAction(Zend_Registry::get('view')->fixUrl('parser'));
        
        $text=new Zend_Form_Element_Text('text');
        $text->setLabel('Tag')
              ->addFilter('StringTrim')
              ->addFilter('StripTags')
              ->addValidator('StringLength', 
                              true, 
                              array(
                                    'min' => 3,
                                    'max'=> 255
                                    )
                              )
               ->addDecorator(new Parser_Form_ParserDecorator())
               ->setRequired(true);
        
        $submit=new Zend_Form_Element_Submit('submit');
        $submit->setValue('Send')
                ->setLabel('')
                ->addDecorator(new Parser_Form_ParserDecorator());
               
        $csrf=new Zend_Form_Element_Hash('csrf',array('salt' => 'parser'));
        $csrf->setOptions(array(
                            'ignore' => true,
                        ))
              ->addDecorator(new Parser_Form_ParserDecorator());
               
        $this->addElements(array(
            $text,
            $submit,
            $csrf
         )); 
    }


}

